<?php
View::content();
$urlface = "http://www.descargatump3.com" . $_SERVER['REQUEST_URI'];
if (isset($datos)):
    $musicaRelacionada = $datos['tituloMusica'];
    ?>
    <script type="text/javascript">
        $(document).ready(function() {
            $(".ventana").fancybox({
                'width': 390,
                'height': 480,
                'autoScale': false,
                'overlayColor': '#000',
                'overlayOpacity': 0.5,
                'transitionIn': 'none',
                'transitionOut': 'none',
                'type': 'iframe'
            });
            $('#reproduccion').hide();
        });
        function bookmark() {
            return "<?php echo md5("descargatump3.com"); ?>"
        }
    </script>
    <?php
    //if ($datos['titulo'] != "secure"): 
    if (isset($urlDescarga)):
        ?>
        <div id="titulomusica">
            <?php
            echo "<h1>" . $datos['titulo'] . "</h1>";
            //echo "<h3>(" . $datos['artista'] . ")</h3>";
            ?>
        </div>
        <div>Reproducir:</div>
        <div class="reproductor">
            <div id="elswf"></div>
        </div>
        <script type="text/javascript">
            swfobject.embedSWF("<?php echo PUBLIC_PATH ?>swf/reprito.swf", "elswf", "450", "30", "9.0.28.0", "", {mp3: "<? echo $urlDescarga ?>", width: "450", loop: "1", autoplay: "0", showstop: "1", showinfo: "0", showvolume: "1", bgcolor1: "870000", bgcolor2: "870000"}, {wmode: "transparent", menu: "false", quality: "high", bgcolor: "#FFFFFF", allowFullScreen: "true"}, {});
        </script>
    <?php else: ?>
        <div id="cargador">
            <div align="center"><img src="<?php echo PUBLIC_PATH ?>images/loader.gif" alt="cargador"/></div>
            <div style="text-align: center;font-weight: bold;">Cargando...espere por favor!!!</div>
        </div>
        <div id="titulomusica">
            <h1></h1>
            <h3></h3>
        </div>
        <div id="datos"></div>
        <div id="reproduccion">
            <div>Reproducir:</div>
            <div class="reproductor">
                <div id="elswf"></div>
            </div>
        </div>
        <script type="text/javascript">
            function getInfo() {
                $('#cargador').hide();
                titulo = document.getElementById("datos").getTitulo();
                artista = document.getElementById("datos").getArtista();
                if (artista.length <= 1) {
                    artista = "DescargaTuMp3.Com";
                }
                url = document.getElementById("datos").getUrl();
                $('#reproduccion').show();
                $('#titulomusica h1').text(titulo);
                $('#titulomusica h3').text(artista);
                $('#descargaM').attr("href", "/popup/descarga/" + titulo + "/" + artista + "/" + $.base64.encode(url));
                $('#dedicaM').attr("href", "/popup/dedicarMusica/" + titulo + "/" + artista + "/" + $.base64.encode('<?php echo $urlface ?>'));
                $('#reportaM').attr("href", "/popup/reportarError/" + titulo + "/" + artista + "/" + $.base64.encode('<?php echo $urlface ?>'));
                swfobject.embedSWF("<?php echo PUBLIC_PATH ?>swf/reprito.swf", "elswf", "450", "30", "9.0.28.0", "", {mp3: url, width: "450", loop: "1", autoplay: "0", showstop: "1", showinfo: "0", showvolume: "1", bgcolor1: "870000", bgcolor2: "870000"}, {wmode: "transparent", menu: "false", quality: "high", bgcolor: "#FFFFFF", allowFullScreen: "true"}, {});
            }
            $(document).ready(function() {
                swfobject.embedSWF("<?php echo PUBLIC_PATH ?>swf/datos.swf", "datos", "1", "1", "9.0.28.0", "", {idG: "<?php echo $idMusica; ?>"}, {wmode: "transparent", menu: "false", quality: "high", bgcolor: "#FFFFFF", allowFullScreen: "true"}, {});
                setTimeout("getInfo()", 10000);
            });
        </script>
    <?
//Flash::error("En estos momentos estamos en mantenimiento, mientras busque su musica en <a href='/youtube/'>servidor 2</a>");
    endif;
    ?>
    <div class="me-gusta">
        <?php View::partial('web/meGusta', false, array('url' => 'http://descargatump3.com' . $_SERVER['REQUEST_URI'])); ?>
    </div>
    <div align="center">
        <a href="/popup/descarga/<?php echo $datos['titulo'] ?>/<?= base64_encode($urlDescarga) ?>" class='ventana' id="descargaM"><img src="/images/download2.png" alt="Descargar" title="Descargar" style="border:0px;"/></a>
        <a href="/popup/dedicarMusica/<?php echo $datos['titulo'] ?>/<?= base64_encode($urlface) ?>" class='ventana' id="dedicaM"><img src="/images/dedicar2.png" alt="Dedicar M&uacute;sica" title="Dedicar M&uacute;sica" style="border:0px;"/></a>
        <a href="/popup/reportarError/<?php echo $datos['titulo'] ?>/<?= base64_encode($urlface) ?>" class='ventana' id="reportaM"><img src="/images/report_error.jpg"  alt="Reportar Error" title="Reportar Error" style="border:0px;"/></a>
    </div>
<?php endif; ?>
<h3>M&uacute;sica Relacionado:</h3>
<div id="music_rel">
    <?php
    View::partial('web/musicaRelacionada', false, array('tipo' => 'busqueda', 'value' => $musicaRelacionada));
    ?>
</div>
<!-- BEGIN SMOWTION TAG - 300x250 - DO NOT MODIFY -->
<script type="text/javascript"><!--
smowtion_size = "300x250";
    smowtion_section = "3479186";
//-->
</script>
<script type="text/javascript"
        src="http://ads.smowtion.com/ad.js?s=3479186&amp;z=300x250">
</script>
<!-- END SMOWTION TAG - 300x250 - DO NOT MODIFY -->
<h3>Escribir Comentario</h3>
<?php
View::partial('web/comentario', false, array('url' => $urlface));
?>